﻿using Engine.Entities.Character;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Assets.Game.scripts.ui.models {
    public class CharacterItemRendererModel : MonoBehaviour {

        public SteveBrain data;

        public string name {
            get {
                return this.data.model.Name;
            }
        }

        public string surname {
            get {
                return this.data.model.Surname;
            }
        }

        public int level {
            get {
                return this.data.model.LV;
            }
        }

        public int healthPoints {
            get {
                return this.data.model.HP;
            }
        }

        public int happynessPoints {
            get {
                return this.data.model.Happiness;
            }
        }

        public int experiencePoints {
            get {
                return this.data.model.Exp;
            }
        }

        public GenderEnum gender {
            get {
                return this.data.model.Gender;
            }
        }

        public string HappynessStr {
            get {
                if (this.data != null)
                    return this.data.model.Happiness.ToString()+"%";
                else
                    return "0%";
            }
        }

        public string ExpStr {
            get {
                if (this.data!=null)
                    return this.data.model.Exp + "/" + FrenzyPeopleController.instance.GetMaxExp(this.data.model.LV);
                else
                    return "-/-";
            }
        }

        public float ExpFract {
            get {
                if (this.data != null)
                    return this.data.model.Exp / FrenzyPeopleController.instance.GetMaxExp(this.data.model.LV);
                else
                    return 0;
            }
        }

        public string HPStr {
            get {
                if (this.data != null)
                    return this.data.model.HP + "/" + FrenzyPeopleController.instance.GetMaxHP(this.data.model.LV);
                else
                    return "-/-";
            }
        }

        public float HPFract {
            get {
                if (this.data != null)
                    return this.data.model.HP / FrenzyPeopleController.instance.GetMaxHP(this.data.model.LV);
                else
                    return 0;
            }
        }

        public string AVGStr {
            get {
                if (this.data != null)
                    return FrenzyPeopleController.instance.GetAVGSkills(this.data.model.Skills).ToString() + " %";
                else
                    return "ND.";
            }
        }

        public float AVGFract {
            get {
                if (this.data!=null)
                    return FrenzyPeopleController.instance.GetAVGSkills(this.data.model.Skills);
                else
                    return 0;
            }
        }
    }
}
